﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="SendQuery.aspx.cs" Inherits="Pages_Public_SendQuery" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageHeader" Runat="Server">
    <script language="javascript" type="text/javascript">
        function ValidateInterestSelection(sender, args) {
            if ($("input[name='chkInterestedProperty']:checked").length > 0)
                args.IsValid = true;
            else
                args.IsValid = false;
        }
        $(document).ready(function () {
            $("input[name='chkInterestedProperty'][value='<%= ConfigReader.OtherPropertyTypeID %>']").click(function () {
                if ($(this).is(':checked'))
                    $('#divOtherProperty').slideDown();
                else
                    $('#divOtherProperty').slideUp();
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" Runat="Server">
     <h4 id="h4Heading" runat="server">Send Query</h4>
    <div id="divMessage" class="ErrorMessageBox" runat="server" visible="false" style="display:block; margin-bottom:15px;"></div>
    
    <asp:Panel ID="pnlFormContainer" runat="server">
        <div class="WizardContainer">
            <div class="StepHeaderContainer">
                <div class="StepHeading">
                    <asp:Label ID="lblMemberShipType" runat="server" Text="Send Your Query to Us"></asp:Label>
                </div>
                <div class="StepSubHeading"><asp:Label ID="Label1" runat="server" Text="Fill out the form below and let us think for you."></asp:Label></div>
            </div>
            <div class="StepBody">
                <table cellpadding="3" cellspacing="0" style="width:70%;">
                    <colgroup>
                        <col style="width:27%;" />
                        <col />
                    </colgroup>
                    <tr id="trSellType" runat="server">
                        <td colspan="2">
                            <div class="CaptionBox">
                                <asp:RadioButtonList ID="rdblBuySellAdvertise" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Text="Buy" Value="B" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="Sell" Value="S"></asp:ListItem>
                                    <asp:ListItem Text="Advertise" Value="A"></asp:ListItem>
                                    <asp:ListItem Text="Joint Venture" Value="J"></asp:ListItem>
                                </asp:RadioButtonList>
                            </div>
                        </td>
                    </tr>
                    <tr>
					    <td><asp:Label ID="lblContactName" runat="server" Text="Contact Name"></asp:Label><span class="requiredMark">*</span></td>
					    <td>
						    <asp:TextBox ID="txtContactName" MaxLength="100" runat="server"></asp:TextBox>
						    <asp:RequiredFieldValidator ID="rfvContactName" runat="server"
							    ControlToValidate="txtContactName" SetFocusOnError="true"
							    ErrorMessage="Please Enter a Contact Name." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
					    </td>
				    </tr>
				    <tr>
					    <td><asp:Label ID="Label2" runat="server" Text="Contact Number"></asp:Label><span class="requiredMark">*</span></td>
					    <td>
						    <asp:TextBox ID="txtContactNumber" MaxLength="50" runat="server"></asp:TextBox>
						    <asp:RequiredFieldValidator ID="rfvContactNumber" runat="server"
							    ControlToValidate="txtContactNumber" SetFocusOnError="true"
							    ErrorMessage="Please Enter a Contact Number." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
					    </td>
				    </tr>
				    <tr>
					    <td><asp:Label ID="lblCountry" runat="server" Text="Country"></asp:Label><span class="requiredMark">*</span></td>
					    <td>
						    <asp:DropDownList ID="ddlCountryID" runat="server"></asp:DropDownList>
						    <asp:RequiredFieldValidator ID="rfvCountryID" runat="server"
							    ControlToValidate="ddlCountryID" SetFocusOnError="true"
							    ErrorMessage="Please Select a Country." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
					    </td>
				    </tr>
                    <tr>
                        <td><asp:Label ID="lblPropertyType" runat="server" Text="Interested on"></asp:Label><span class="requiredMark">*</span></td>
                        <td>
                            <div id="divPropertyTypes" runat="server"></div>
                            <div id="divOtherProperty" style="display:none;">
                                <table cellspacing="0" cellpadding="0" style="width:100%;">
                                    <tr>
                                        <td style="padding:5px 0px 5px 0px;"><asp:Label ID="Label3" runat="server" Text="Write your Other Interest"></asp:Label></td>
                                        <td style="width:60%; padding:5px 0px 5px 5px;"><asp:TextBox ID="txtOtherProperty" runat="server"></asp:TextBox></td>
                                    </tr>
                                </table>                                
                            </div>
                            <asp:CustomValidator ID="CustomValidator1" runat="server"
                                Display="Dynamic" SetFocusOnError="true" ClientValidationFunction="ValidateInterestSelection"
                                ValidationGroup="SaveInfo" ValidateEmptyText="true"
                                ErrorMessage="Please Select few of your Interests.">
                            </asp:CustomValidator>                            
                        </td>
                    </tr>
                    <tr>
					    <td><asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label><span class="requiredMark">*</span></td>
					    <td>
						    <asp:TextBox ID="txtEmail" MaxLength="50" runat="server"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                ControlToValidate="txtEmail" Display="Dynamic" SetFocusOnError="true"
                                ErrorMessage="Please enter a valid Email address."
                                ValidationGroup="SaveInfo">
                            </asp:RegularExpressionValidator>

                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
							    ControlToValidate="txtEmail" SetFocusOnError="true"
							    ErrorMessage="Please enter Email." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>

					    </td>
				    </tr>
				    <tr>
					    <td><asp:Label ID="lblMessage" runat="server" Text="Message"></asp:Label><span class="requiredMark">*</span></td>
					    <td>
						    <asp:TextBox ID="txtMessage" TextMode="MultiLine" MaxLength="8000" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
							    ControlToValidate="ddlCountryID" SetFocusOnError="true"
							    ErrorMessage="Please enter your Message." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
					    </td>
				    </tr>				    				    
                </table>
            </div>
            <div class="StepButtonContainer">
                <asp:Button ID="btnSave" runat="server" Text="Send" ValidationGroup="SaveInfo" OnClick="btnSave_Click" />
            </div>
        </div>
    </asp:Panel>
</asp:Content>

